package cn.com.cetccst.datacenter.collection.dao;

import androidx.room.Dao;
import androidx.room.Query;

import java.util.List;

import cn.com.cetccst.datacenter.collection.entity.CollectionDataEntity;

@Dao
public interface CollectionDataDao extends BaseDao<CollectionDataEntity> {

    @Query("select * from " + CollectionDataEntity.TABLE_NAME + " where collect_type = :type")
    List<CollectionDataEntity> query(String type);

    @Query("select * from " + CollectionDataEntity.TABLE_NAME)
    List<CollectionDataEntity> queryAll();

    @Query("delete from " + CollectionDataEntity.TABLE_NAME + " where collect_type = :type")
    void delete(String type);

    @Query("delete from " + CollectionDataEntity.TABLE_NAME)
    void clear();
}
